package cn.edu.neusoft.wuguangsheng.market.service;

import java.util.List;

import cn.edu.neusoft.wuguangsheng.market.bean.AllCommentBean;
import cn.edu.neusoft.wuguangsheng.market.bean.CartFoodsBean;
import cn.edu.neusoft.wuguangsheng.market.bean.CartPriceBean;
import cn.edu.neusoft.wuguangsheng.market.bean.FoodByIdBean;
import cn.edu.neusoft.wuguangsheng.market.bean.FoodByShopBean;
import cn.edu.neusoft.wuguangsheng.market.bean.LoginBean;
import cn.edu.neusoft.wuguangsheng.market.bean.MarketBean;
import cn.edu.neusoft.wuguangsheng.market.bean.MyBean;
import cn.edu.neusoft.wuguangsheng.market.bean.OrderFoodInfo;
import cn.edu.neusoft.wuguangsheng.market.bean.OrderFoodResut;
import cn.edu.neusoft.wuguangsheng.market.bean.RegisterBean;
import cn.edu.neusoft.wuguangsheng.market.bean.ShowCartBean;
import cn.edu.neusoft.wuguangsheng.market.bean.UserAllCommentBean;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;

/**
 * Created by little on 2018/4/4.
 */

public interface AllService {
    //登陆
    //http://119.29.247.188/market/public/index.php/admin/Api/userLogin?username=wuguangsheng&password=1234
    @GET("market/public/index.php/admin/Api/userLogin")
    public Call<LoginBean> getUser(@Query("username") String username,
                                   @Query("password") String password);



    //注册
    //http://119.29.247.188/market/public/index.php/admin/Api/userRegister?username=wuguangsheng&password=123&phone=18004091028&address=大连东软信息学院
    @GET("market/public/index.php/admin/Api/userRegister")
    public Call<RegisterBean> getReg(@Query("username") String username,
                                     @Query("password") String password,
                                     @Query("phone") String phone,
                                     @Query("address") String address);
    //获取所有农贸
    //http://119.29.247.188/market/public/index.php/admin/Api/getAllMarket
    @GET("market/public/index.php/admin/Api/getAllMarket")
    public Call<List<MarketBean>> showMarketList();

    //获取农贸所有菜品
   // http://119.29.247.188/market/public/index.php/admin/api/getFoodByShop?mrid=1
    @GET("market/public/index.php/admin/api/getFoodByShop")
    public Call<List<FoodByShopBean>> showFoodByShoplist(@Query("mrid")String mrid);
    //获取用户信息
    //http://119.29.247.188/market/public/index.php/admin/api/getUserById?uid=11
    @GET("market/public/index.php/admin/api/getUserById")
    public Call<MyBean> getMyinfo(@Query("uid")String uid);
    //获取菜品详情
    //http://119.29.247.188/market/public/index.php/admin/api/getFoodById?fid=2
    @GET("market/public/index.php/admin/api/getFoodById")
    public Call<FoodByIdBean> showFoodById(@Query("fid")String fid);

   //加入购物车
    //http://119.29.247.188//market/public/index.php/adminapi/addCart?uid=11&fid=1&num=5&sum=23.6&mrid=2
    @GET("market/public/index.php/admin/api/addCart")
    public Call<RegisterBean> addCart(@Query("uid")String uid,
                                      @Query("fid")String fid,
                                      @Query("num")String num,
                                      @Query("sum")double sum,
                                      @Query("mrid")String mrid);

    //单个购买
    //http://119.29.247.188/market/public/index.php/admin/api/insertOrder?uid=2&fid=3&num=1&sum=2.6&suggesttime=12:00-13:00
    @GET("market/public/index.php/admin/api/insertOrder")
    public  Call<RegisterBean> BuyOneFoods(@Query("uid")String uid,
                                           @Query("fid")String fid,
                                           @Query("num")String num,
                                           @Query("sum")double sum,
                                           @Query("mrid")String mrid,
                                           @Query("suggesttime")String suggesttime);
    //修改用户信息
    //http://119.29.247.188/market/public/index.php/admin/api/updateUserById?uid=11&username=吴光胜&userpass=123&phone=15339526113&address=大连市东软信息学院
    @GET("market/public/index.php/admin/api/updateUserById")
    public Call<RegisterBean> setMyInfo(@Query("uid")String uid,
                                        @Query("username")String username,
                                        @Query("phone")String phone,
                                        @Query("address")String address);

    //显示购物车信息
    //http://119.29.247.188/market/public/index.php/admin/api/showCart?uid=11
    @GET("market/public/index.php/admin/api/showCart")
    public Call<List<ShowCartBean>> showCart(@Query("uid")String uid);

    //获取用户所有订单
    //http://119.29.247.188/market/public/index.php/admin/api/getAllUserOrder?uid=11
    @GET("market/public/index.php/admin/api/getAllUserOrder")
    public Call<List<OrderFoodResut>> showOrder(@Query("uid")String uid);

    //获取订单下面所有菜品
   //http://119.29.247.188/market/public/index.php/admin/api/getOrderFoods?orid=12
    @GET("market/public/index.php/admin/api/getOrderFoods")
    public  Call<List<OrderFoodInfo>> showOrderInfo(@Query("orid")String orid);



//添加评论
   //http://119.29.247.188/market/public/index.php/admin/api/insertComment?orid=1&fid=1&content=好好吃&uid=11
@GET("market/public/index.php/admin/api/insertComment")
public Call<RegisterBean> insertComment(@Query("orid")String orid,
                                        @Query("content")String content,
                                        @Query("fid")String fid,
                                        @Query("uid")String uid,
                                        @Query("mrid")String mrid);


   //获取用户所有评论
    //http://119.29.247.188/market/public/index.php/admin/api/getAllUserComment?uid=12
    @GET("market/public/index.php/admin/api/getAllUserComment")
    public Call<List<UserAllCommentBean>> showUserAllComment(
            @Query("uid")String uid);


 //获取订单菜品信息
  //http://119.29.247.188/market/public/index.php/admin/api/getAllUserFoodOrder?fid=3
    @GET("market/public/index.php/admin/api/getAllUserFoodOrder")
    public Call<List<AllCommentBean>> showAllComment(@Query("fid")String fid);



//修改评论
    //http://119.29.247.188/market/public/index.php/admin/api/updateComment?orid=9&fid=1&content=不好吃啊
    @GET("market/public/index.php/admin/api/updateComment")
    public Call<RegisterBean> updateComment(@Query("orid")String orid,
                                            @Query("fid")String fid,
                                            @Query("content")String content);



    //删除评论
    //http://119.29.247.188/market/public/index.php/admin/api/deleteComment??fid=1&orid=9
    @GET("market/public/index.php/admin/api/deleteComment")
    public Call<RegisterBean> deleteComment(@Query("fid")String fid,
                                            @Query("orid")String orid);

    //搜索菜品
   // http://119.29.247.188/market/public/index.php/admin/api/getFoodBySearch?search=大白菜
    @GET("market/public/index.php/admin/api/getFoodBySearch")
    public Call<List<FoodByShopBean>> search(@Query("search")String search);



    //显示购物车下的菜品
   // http://119.29.247.188/market/public/index.php/admin/api/showCartFoods?uid=11&mrid=1
    @GET("market/public/index.php/admin/api/showCartFoods")
    public Call<List<CartFoodsBean>> showCartFoods(@Query("uid")String uid,
                                                       @Query("mrid")String mrid);



    //显示购物车所有菜品价格
    //http://119.29.247.188/market/public/index.php/admin/api/getAllprice?uid=14&mrid=2
    @GET("market/public/index.php/admin/api/getAllprice")
    public Call<CartPriceBean> showCartPrice(@Query("uid")String uid,
                                             @Query("mrid")String mrid);



    //设置购物车商品购买状态
    //http://119.29.247.188/market/public/index.php/admin/api/setCartFlag?cid=1&flag=1
    @GET("market/public/index.php/admin/api/setCartFlag")
    public Call<RegisterBean> cartSetFlag(@Query("cid")String cid,
                                          @Query("flag")String flag);


    //删除购物车商品
    //http://119.29.247.188/market/public/index.php/admin/api/deleteCart?cid=1
    @GET("market/public/index.php/admin/api/deleteCart")
    public Call<RegisterBean> delectCart(@Query("cid")String cid);


    //修改商品数量
 //http://119.29.247.188/market/public/index.php/admin/api/setCartNum?cid=6&num=6
    @GET("market/public/index.php/admin/api/setCartNum")
    public Call<RegisterBean> setCartNum(@Query("cid")String cid,
                                         @Query("num")int num);



    //购物车购买
    //http://119.29.247.188/market/public/index.php/admin/api/cartBuy?uid=11&suggesttime=12:00-13:00&mrid=2
   @GET("market/public/index.php/admin/api/cartBuy")
    public Call<RegisterBean> cartBuy(@Query("uid")String uid,
                                      @Query("suggesttime")String suggesttime,
                                      @Query("mrid")String mrid
                                      );


   //修改用户密码
    //http://119.29.247.188/market/public/index.php/admin/api/updatePass?uid=11&userpass=123;
    @GET("market/public/index.php/admin/api/updatePass")
        public Call<RegisterBean> setPassword(@Query("uid")String uid,
                                              @Query("userpass")String userpass);


}
